import crtkc from "./crtkc";
import { prv } from "./prv";


const { ccclass, property } = cc._decorator;

@ccclass
export default class channelInit extends cc.Component {

    @property(cc.Label)
    ruanzhu: cc.Label = null;
    // @property(cc.Label)
    // label: cc.Label = null;

    // @property
    // text: string = 'hello';

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        //这里作为入口初始化
        crtkc.init();
        prv.init();
        this.ruanzhu.string = prv.getRuanZhu();

    }

    start() {

    }

    update(dt) {
        crtkc.saveExe();
        if ((window as any).countDown && (window as any).countDown == 2)
            if ((window as any).countTime > 0) {
                (window as any).countTime -= dt;
                if ((window as any).countTime <= 0) {
                    //@ts-ignore
                    window.__prv.doAction(5, ['ks']);
                    //@ts-ignore
                    (window as any).countTime = window.__prv.getCtrl('p5');
                }
            }
    }
}
